<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" 
"http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<p:dialog xmlns="http://www.w3.org/1999/xhtml"
	xmlns:ui="http://java.sun.com/jsf/facelets"
	xmlns:h="http://java.sun.com/jsf/html"
	xmlns:f="http://java.sun.com/jsf/core"
	xmlns:p="http://primefaces.org/ui" 
	xmlns:pe="http://primefaces.org/ui/extensions"
	modal="true" width="600" height="400" resizable="false" 
	widgetVar="dialogAddServico" id="dialogServico" closable="false"
	appendToBody="true">

	<link type="text/css" rel="stylesheet" href="../../resources/css/style.css" />
	
	<f:facet name="header">
		<h:outputText value="Cadastrar Serviço" />
	</f:facet>
	
	<h:form id="formAddServico" prependId="false">
		<p:messages id="messageFormServico"/>
		
		<h:panelGrid columns="2" style="padding:5px;">
			<h:outputText value="Código" />
			<h:outputText value="Descrição *" />
			
			<p:inputText style="width:100px;" disabled="true" value="#{funcionarioBean.newServico.id}"/>
			<p:inputText style="width:410px;" value="#{funcionarioBean.newServico.descricao}" required="true" requiredMessage="Informe a descrição." maxlength="40"/>
		</h:panelGrid>
	
		<h:panelGrid columns="4" style="padding:5px;">			
			<h:outputText value="Valor mão de obra" />			
			<h:outputText value="Valor do serviço *" />	
			<h:outputText value="Comissão" />	
			<h:outputText value="Tempo médio" />
			
			<pe:inputNumber style="width:120px;" value="#{funcionarioBean.newServico.valorMaoObra}" decimalSeparator="," decimalPlaces="2"  thousandSeparator="." maxValue="100000"/>
			<pe:inputNumber style="width:120px;" value="#{funcionarioBean.newServico.valorServico}" decimalSeparator="," decimalPlaces="2"  thousandSeparator="." required="true" requiredMessage="Informe o valor do serviço."  maxValue="100000"/>
			<pe:inputNumber style="width:120px;" value="#{funcionarioBean.newServico.comissao}" decimalSeparator="," decimalPlaces="2"  thousandSeparator="." maxValue="100000"/>
			<pe:inputNumber style="width:120px;" value="#{funcionarioBean.newServico.tempoMedio}" decimalPlaces="0" maxValue="100000"/>
		</h:panelGrid>

		<h:panelGrid columns="1" style="padding:5px;">	
			<h:outputText value="Observações" />		
			<p:inputTextarea style="width:520px; height:80px;" value="#{funcionarioBean.newServico.observacao}" maxlength="255"/>	
		</h:panelGrid>

		<h:panelGrid columns="1" style="padding:5px;">
			<h:outputText value="* Campos obrigatórios" />
		</h:panelGrid>
		
		<div id="popup-buttons" style="padding-bottom: 10px;padding-right: 15px; padding-top: 10px; text-align: right;">
			<p:commandButton value="Salvar" style="height:28px;" update="formAddServico, messageFormServico" actionListener="#{funcionarioBean.saveServicoFromDialog}" icon="ui-icon-disk"/>
			<p:commandButton value="Cancelar" style="height:28px;" actionListener="#{funcionarioBean.closeDialogAddServico}" immediate="true" icon="ui-icon-cancel"/>
		</div>
	</h:form>
</p:dialog>